package com.example.personnel_oa.controller;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.read.builder.ExcelReaderBuilder;
import com.example.comment_oa.pojos.Talentpool;
import com.example.comment_oa.response.AjaxResponse;
import com.example.personnel_oa.dubbo.AccountListener;
import com.example.personnel_oa.mapper.TalentpoolMapper;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.io.IOException;

@RestController
@CrossOrigin
@RequestMapping("/personnelOa")

public class  TalentpoolDaoruController {

    @Resource
    TalentpoolMapper talentpoolMapper;

    @RequestMapping("Talentpool/daoru")
    public AjaxResponse daoru(@RequestParam("files") MultipartFile files) throws IOException {
        ExcelReaderBuilder hh = EasyExcel.read(files.getInputStream(), Talentpool.class,
                new AccountListener(talentpoolMapper));
        hh.sheet().doRead();
        return AjaxResponse.success("11");
    }
}

